/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Utilities
*        文件名:             BaseCodeChange.cs
*        创建系统时间:       2012/11/2 19:07:07
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Utilities
{
    using System;
    using System.Globalization;

    public class BaseCodeChange
    {
        public static bool CheckRegister()
        {
            return true;
        }

        public static string CodeChange(string code)
        {
            string str = string.Empty;
            if (code.Length == 0)
            {
                return str;
            }
            string[] strArray = new string[code.Length * 2];
            long[] numArray = CreateArray((long)code.Length);
            int num = 0;
            for (int i = 0; i < code.Length; i++)
            {
                num = Convert.ToChar(code.Substring(i, 1), CultureInfo.CurrentCulture);
                strArray[i] = Convert.ToString((long)(((long)((num * 0x49) + 14)) / numArray[i]), (IFormatProvider)CultureInfo.CurrentCulture);
                strArray[code.Length + i] = Convert.ToString((long)(((long)((num * 0x49) + 14)) % numArray[i]), (IFormatProvider)CultureInfo.CurrentCulture);
            }
            return string.Join("O", strArray);
        }

        private static long[] CreateArray(long length)
        {
            long[] numArray = new long[length + 2L];
            numArray[0] = 0x34L;
            numArray[1] = 0x21fL;
            for (int i = 2; i < (length + 2L); i++)
            {
                numArray[i] = numArray[i - 1] + numArray[i - 2];
            }
            return numArray;
        }
    }
}